home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / PictUtils.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  8.9 KB  |  249 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PictUtils.p
  3.  
  4.      Contains:    Picture Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT PictUtils;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __PICTUTILS__}
  28. {$SETC __PICTUTILS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC PictUtilsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __PALETTES__}
  38. {$I Palettes.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. { verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls }
  47.  
  48. CONST
  49.     returnColorTable            = $0001;
  50.     returnPalette                = $0002;
  51.     recordComments                = $0004;
  52.     recordFontInfo                = $0008;
  53.     suppressBlackAndWhite        = $0010;
  54.  
  55.                                                                 {  color pick methods  }
  56.     systemMethod                = 0;                            {  system color pick method  }
  57.     popularMethod                = 1;                            {  method that chooses the most popular set of colors  }
  58.     medianMethod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                                                                 {  color bank types  }
  60.     ColorBankIsCustom            = -1;
  61.     ColorBankIsExactAnd555        = 0;
  62.     ColorBankIs555                = 1;
  63.  
  64.  
  65. TYPE
  66.     PictInfoID                            = LONGINT;
  67.     CommentSpecPtr = ^CommentSpec;
  68.     CommentSpec = RECORD
  69.         count:                    INTEGER;                                {  number of occurrances of this comment ID  }
  70.         ID:                        INTEGER;                                {  ID for the comment in the picture  }
  71.     END;
  72.  
  73.     CommentSpecHandle                    = ^CommentSpecPtr;
  74.     FontSpecPtr = ^FontSpec;
  75.     FontSpec = RECORD
  76.         pictFontID:                INTEGER;                                {  ID of the font in the picture  }
  77.         sysFontID:                INTEGER;                                {  ID of the same font in the current system file  }
  78.         size:                    ARRAY [0..3] OF LONGINT;                {  bit array of all the sizes found (1..127) (bit 0 means > 127)  }
  79.         style:                    INTEGER;                                {  combined style of all occurrances of the font  }
  80.         nameOffset:                LONGINT;                                {  offset into the fontNamesHdl handle for the font’s name  }
  81.     END;
  82.  
  83.     FontSpecHandle                        = ^FontSpecPtr;
  84.     PictInfoPtr = ^PictInfo;
  85.     PictInfo = RECORD
  86.         version:                INTEGER;                                {  this is always zero, for now  }
  87.         uniqueColors:            LONGINT;                                {  the number of actual colors in the picture(s)/pixmap(s)  }
  88.         thePalette:                PaletteHandle;                            {  handle to the palette information  }
  89.         theColorTable:            CTabHandle;                                {  handle to the color table  }
  90.         hRes:                    Fixed;                                    {  maximum horizontal resolution for all the pixmaps  }
  91.         vRes:                    Fixed;                                    {  maximum vertical resolution for all the pixmaps  }
  92.         depth:                    INTEGER;                                {  maximum depth for all the pixmaps (in the picture)  }
  93.         sourceRect:                Rect;                                    {  the picture frame rectangle (this contains the entire picture)  }
  94.         textCount:                LONGINT;                                {  total number of text strings in the picture  }
  95.         lineCount:                LONGINT;                                {  total number of lines in the picture  }
  96.         rectCount:                LONGINT;                                {  total number of rectangles in the picture  }
  97.         rRectCount:                LONGINT;                                {  total number of round rectangles in the picture  }
  98.         ovalCount:                LONGINT;                                {  total number of ovals in the picture  }
  99.         arcCount:                LONGINT;                                {  total number of arcs in the picture  }
  100.         polyCount:                LONGINT;                                {  total number of polygons in the picture  }
  101.         regionCount:            LONGINT;                                {  total number of regions in the picture  }
  102.         bitMapCount:            LONGINT;                                {  total number of bitmaps in the picture  }
  103.         pixMapCount:            LONGINT;                                {  total number of pixmaps in the picture  }
  104.         commentCount:            LONGINT;                                {  total number of comments in the picture  }
  105.         uniqueComments:            LONGINT;                                {  the number of unique comments in the picture  }
  106.         commentHandle:            CommentSpecHandle;                        {  handle to all the comment information  }
  107.         uniqueFonts:            LONGINT;                                {  the number of unique fonts in the picture  }
  108.         fontHandle:                FontSpecHandle;                            {  handle to the FontSpec information  }
  109.         fontNamesHandle:        Handle;                                    {  handle to the font names  }
  110.         reserved1:                LONGINT;
  111.         reserved2:                LONGINT;
  112.     END;
  113.  
  114.     PictInfoHandle                        = ^PictInfoPtr;
  115. {$IFC TYPED_FUNCTION_POINTERS}
  116.     InitPickMethodProcPtr = FUNCTION(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16): OSErr;
  117. {$ELSEC}
  118.     InitPickMethodProcPtr = ProcPtr;
  119. {$ENDC}
  120.  
  121.     InitPickMethodUPP = UniversalProcPtr;
  122.  
  123. CONST
  124.     uppInitPickMethodProcInfo = $00000FA0;
  125.  
  126. FUNCTION NewInitPickMethodProc(userRoutine: InitPickMethodProcPtr): InitPickMethodUPP;
  127.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  128.     INLINE $2E9F;
  129.     {$ENDC}
  130.  
  131. FUNCTION CallInitPickMethodProc(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16; userRoutine: InitPickMethodUPP): OSErr;
  132.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  133.     INLINE $205F, $4E90;
  134.     {$ENDC}
  135.  
  136. TYPE
  137. {$IFC TYPED_FUNCTION_POINTERS}
  138.     RecordColorsProcPtr = FUNCTION(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32): OSErr;
  139. {$ELSEC}
  140.     RecordColorsProcPtr = ProcPtr;
  141. {$ENDC}
  142.  
  143.     RecordColorsUPP = UniversalProcPtr;
  144.  
  145. CONST
  146.     uppRecordColorsProcInfo = $00003FE0;
  147.  
  148. FUNCTION NewRecordColorsProc(userRoutine: RecordColorsProcPtr): RecordColorsUPP;
  149.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  150.     INLINE $2E9F;
  151.     {$ENDC}
  152.  
  153. FUNCTION CallRecordColorsProc(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32; userRoutine: RecordColorsUPP): OSErr;
  154.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  155.     INLINE $205F, $4E90;
  156.     {$ENDC}
  157.  
  158. TYPE
  159. {$IFC TYPED_FUNCTION_POINTERS}
  160.     CalcColorTableProcPtr = FUNCTION(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray): OSErr;
  161. {$ELSEC}
  162.     CalcColorTableProcPtr = ProcPtr;
  163. {$ENDC}
  164.  
  165.     CalcColorTableUPP = UniversalProcPtr;
  166.  
  167. CONST
  168.     uppCalcColorTableProcInfo = $00003EE0;
  169.  
  170. FUNCTION NewCalcColorTableProc(userRoutine: CalcColorTableProcPtr): CalcColorTableUPP;
  171.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  172.     INLINE $2E9F;
  173.     {$ENDC}
  174.  
  175. FUNCTION CallCalcColorTableProc(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray; userRoutine: CalcColorTableUPP): OSErr;
  176.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  177.     INLINE $205F, $4E90;
  178.     {$ENDC}
  179.  
  180. TYPE
  181. {$IFC TYPED_FUNCTION_POINTERS}
  182.     DisposeColorPickMethodProcPtr = FUNCTION(dataRef: UInt32): OSErr;
  183. {$ELSEC}
  184.     DisposeColorPickMethodProcPtr = ProcPtr;
  185. {$ENDC}
  186.  
  187.     DisposeColorPickMethodUPP = UniversalProcPtr;
  188.  
  189. CONST
  190.     uppDisposeColorPickMethodProcInfo = $000000E0;
  191.  
  192. FUNCTION NewDisposeColorPickMethodProc(userRoutine: DisposeColorPickMethodProcPtr): DisposeColorPickMethodUPP;
  193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  194.     INLINE $2E9F;
  195.     {$ENDC}
  196.  
  197. FUNCTION CallDisposeColorPickMethodProc(dataRef: UInt32; userRoutine: DisposeColorPickMethodUPP): OSErr;
  198.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  199.     INLINE $205F, $4E90;
  200.     {$ENDC}
  201. FUNCTION GetPictInfo(thePictHandle: PicHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  202.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  203.     INLINE $303C, $0800, $A831;
  204.     {$ENDC}
  205. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  206.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  207.     INLINE $303C, $0801, $A831;
  208.     {$ENDC}
  209. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  210.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  211.     INLINE $303C, $0602, $A831;
  212.     {$ENDC}
  213. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  214.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  215.     INLINE $303C, $0403, $A831;
  216.     {$ENDC}
  217. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  218.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  219.     INLINE $303C, $0404, $A831;
  220.     {$ENDC}
  221. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID; VAR thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  222.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  223.     INLINE $303C, $0505, $A831;
  224.     {$ENDC}
  225. FUNCTION DisposePictInfo(thePictInfoID: PictInfoID): OSErr;
  226.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  227.     INLINE $303C, $0206, $A831;
  228.     {$ENDC}
  229. {$IFC OLDROUTINENAMES }
  230. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  231.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  232.     INLINE $303C, $0206, $A831;
  233.     {$ENDC}
  234. {$ENDC}  {OLDROUTINENAMES}
  235.  
  236.  
  237.  
  238.  
  239. {$ALIGN RESET}
  240. {$POP}
  241.  
  242. {$SETC UsingIncludes := PictUtilsIncludes}
  243.  
  244. {$ENDC} {__PICTUTILS__}
  245.  
  246. {$IFC NOT UsingIncludes}
  247.  END.
  248. {$ENDC}
  249.